fix: allow --entry-file to be omitted when entry is defined in config#1348
Merged
fix: allow --entry-file to be omitted when entry is defined in config#1348
--entry-file to be omitted when entry is defined in config#1348Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 0720abe The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
--entry-file to be omitted when entry is defined in config
…tted When --entry-file is not provided, bundleArgs.entryFile is undefined at runtime. The unconditional call to normalizeEntryFile(undefined) crashes with a TypeError before the validation in bundle() can check whether entry is defined in the user's config. Guard the entry override behind an if-check (matching the existing pattern in getEnvOptions) so that omitting --entry-file lets the user's config-defined entry take effect as documented. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ca56de9 to
e37b4f7
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e37b4f7 to
0720abe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
entryoverride ingetCliOverridesso it's only set when--entry-fileis actually provided, preventing aTypeErrorcrash fromnormalizeEntryFile(undefined)BundleArguments.entryFiletype to be optional (string | undefined), matching the runtime reality that the CLI option has no defaultgetCliOverridescovering bothbundleandstartcommand branchesCloses #1343
Details
When
--entry-fileis omitted fromreact-native bundle,bundleArgs.entryFileisundefinedat runtime. The unconditional call tonormalizeEntryFile(undefined)crashes with aTypeErroronpath.isAbsolute(undefined)before the existing validation inbundle()(if (!args.entryFile && !config.entry)) can run.The fix guards the entry override behind an
if (bundleArgs.entryFile)check, matching the existing pattern ingetEnvOptions. This lets users defineentryin their rspack/webpack config without needing to also pass--entry-file.Test plan
getCliOverrides(7 tests, all passing)commands/commontests pass (54 tests, 10 suites)@callstack/repackbuilds cleanly with no type errors🤖 Generated with Claude Code